class ManagerBorrowsController < AdminController
  def index
   
    #history
    @histories = History.all
    respond_to do |format|
      format.html # index.html.erb
      format.json { render json: @histories }
    end
    
  end

  def destroy
    
    #history
    @history = History.find(params[:id])
    @history.destroy

    respond_to do |format|
      format.html { redirect_to manager_borrows_url }
      format.json { head :no_content }
    end
  end

  def delete_multiple

    #history
    if(params[:borrow_ids] != nil)
      @histories = History.find(params[:borrow_ids])
      @histories.each do |history|
        history.destroy
      end
    end

    respond_to do |format|
      format.html { redirect_to manager_borrows_url }
      format.json { head :no_content }
    end
  end
end
